<template>
	<view class="page">

		<form @submit="formSubmit">

			<view class="page-block" style="margin-top: 20rpx;">
				<picker mode="date" @change="dateChange">
					<view class="birthday">{{birthday}}</view>
				</picker>
			</view>

			<button type="primary" form-type="submit" class="submitBtn">提交</button>

		</form>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				birthday: ""
			}
		},
		onLoad() {
			this.birthday = "2011-11-11"
		},
		methods: {
			// 选择日期
			dateChange(e) {
				this.birthday = e.detail.value
			},


			// 表单提交
			formSubmit() {
				// 提交调用后台方法
				uni.navigateBack({
					delta: 1
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.page-fill {
		width: 100%;
		height: 100%;
		position: absolute;
	}

	.graywords {
		color: #eaeaea;
	}

	.input {
		height: 80rpx;
		line-height: 80rpx;
		width: 500rpx;
		margin-left: 40rpx;
	}

	.birthday {
		background-color: #fff;
		height: 80rpx;
		padding-left: 20rpx;
		padding-top: 30rpx;
	}
</style>
